package com.lx.mobileplayer.mvp.persenter

import com.itheima.player.model.bean.MvAreaBean
import com.lx.mobileplayer.mvp.view.Iview.IMvView
import com.lx.mobileplayer.net.OkHttpUtil
import com.lx.mobileplayer.net.URLProvider

/**
 * 类说明：首页的presenter
 * Created by liuxiong on 2019/4/27.
 */
class MvPresenter(view:IMvView):BasePresenter<IMvView>(view) {

    fun requestData(){

        var url= URLProvider.getMVareaUrl()

        OkHttpUtil.instance.request(url,object : OkHttpUtil.ResultCallBack<List<MvAreaBean>>() {
            override fun succecss(data: List<MvAreaBean>) {
                getView().onSuccess(data as ArrayList<MvAreaBean>)
            }

            override fun failed(code: Int, errorMessage: String) {
                getView().onFailed(code,errorMessage)
            }
        })

    }

}